import { Iselector } from './model/selector.model';
import { LoggerService, LoggerInfo } from './../../../framework/logger/logger.service';
import { Component, Input, OnChanges, OnInit } from '@angular/core';
@Component({
    selector: 'wit-selector',
    styleUrls: ['./selector.component.scss'],
    templateUrl: './selector.component.html'
})

export class SelectorComponent implements OnInit, OnChanges {
    @Input() selectorConfig: Iselector;
    currentVal: any;
    constructor(private _logger: LoggerService) { }
    ngOnInit() {
    }
    ngOnChanges() {
        this.selectorConfig.isAutoWidth = true;
    }
    selectChangeVal() {
        if (this.selectorConfig && this.selectorConfig.onChange) {
            this.selectorConfig.onChange(this.currentVal);
        }
    }
    selectFocus(){
        if (this.selectorConfig && this.selectorConfig.onFocus) {
            this.selectorConfig.onFocus(this.currentVal);
        }
    }
    selectBlur(){
        if (this.selectorConfig && this.selectorConfig.onBlur) {
            this.selectorConfig.onBlur(this.currentVal);
        }
    }
}